import {createRouter, createWebHistory} from 'vue-router';
import Index from '@/components/Index';
import Login from "@/components/Login";
import MyList from "@/components/MyList";
import NewList from "@/components/NewList";
import AllList from "@/components/AllList";
import NeedsFormInfo from "@/components/NeedsFormInfo";
import AccomRA from "@/components/AccomRA";
import AccNeedApprove from "@/components/AccNeedApprove";
import DiningRA from "@/components/DiningRA";
import FoodNeedApprove from "@/components/FoodNeedApprove";
import ClassroomRA from "@/components/ClassroomRA";
import ClassroomResources from "@/components/ClassroomResources";
import DormitoryResources from "@/components/DormitoryResources";
import OperationReport from "@/components/OperationReport";
import CheckReport from "@/components/CheckReport";
import ClassroomNeedApprove from "@/components/ClassroomNeedApprove";
import YearReportInfo from "@/components/YearReportInfo";
import MonthReportInfo from "@/components/MonthReportInfo";
import AccCheckInfo from "@/components/AccCheckInfo";
import FoodCheckInfo from "@/components/FoodCheckInfo";
import ClassroomCheckInfo from "@/components/ClassroomCheckInfo";
import MessageRecord from "@/components/MessageRecord";
import MessageInfo from "@/components/MessageInfo";
import UserManage from "@/components/UserManage";
import CharaManage from "@/components/CharaManage";
import PartManage from "@/components/PartManage";
import MessageConfig from "@/components/MessageConfig";
import ClassroomData from "@/components/ClassroomData";
import DormitoryData from "@/components/DormitoryData";
import ErrorPage from "../components/ErrorPage";

const routes = [
    { path: '/', redirect:'/index/myList'},
    { path: '/index', redirect:'/index/myList'},
    { path: '/login', component: Login},
    { path: '/index', component: Index,
        children:[{
            name:"myList",
            path:'myList', component:MyList,
        },{
            path: 'newList',component: NewList,
        },{
            name:"allList",
            path: 'allList',component: AllList
        },{
            path: 'info',component: NeedsFormInfo
        },{
            name:"accomRA",
            path: 'accomRA',component: AccomRA
        },{
            name:"accApp",
            path: 'accApp',component: AccNeedApprove
        },{
            name:"diningRA",
            path: 'diningRA',component: DiningRA
        },{
            name:"foodApp",
            path: 'foodApp',component: FoodNeedApprove
        },{
            name:"classroomRA",
            path: 'classroomRA',component: ClassroomRA
        },{
            name:"classroomResources",
            path: 'classroomResources',component: ClassroomResources
        },{
            name:"dormitoryResources",
            path: 'dormitoryResources',component: DormitoryResources
        },{
            name:"operationReport",
            path: 'operationReport',component: OperationReport
        },{
            name:"checkReport",
            path: 'checkReport',component: CheckReport
        },{
            name:"classApp",
            path: 'classApp',component: ClassroomNeedApprove
        },{
            path: 'yearReport',component: YearReportInfo
        },{
            path: 'monthReport',component: MonthReportInfo
        },{
            path:'accCheck',component: AccCheckInfo
        },{
            path:'foodCheck',component: FoodCheckInfo
        },{
            path: 'classroomCheck',component: ClassroomCheckInfo
        },{
            path: 'messageRecord',component: MessageRecord
        },{
            path: 'messageInfo',component: MessageInfo
        },{
            name:"userManageLook",
            path: 'userManage',component: UserManage
        },{
            name:"charaManageLook",
            path: 'charaManage',component: CharaManage
        },{
            name:"partManageLook",
            path: 'partManage',component: PartManage
        },{
            path: 'messageConfig',component: MessageConfig
        },{
            name:"classroomDataLook",
            path: 'classroomData',component: ClassroomData
        },{
            name:"dormitoryDataLook",
            path: 'dormitoryData',component: DormitoryData
        }]
    },
    {
        path: "/:catchAll(.*)",
        name: "404",
        component: ErrorPage
    },
]
const router = createRouter({
    history: createWebHistory(),
    routes,
})
export default router
